         /* 赋值非空验证 */
 		function isEmpty(obj){
 		    if(typeof obj == "undefined" || obj == null || obj == ""){
 		        return"";
 		    }else{
 		        return obj;
 		    }
 		}
 		
 		 /* 人员选择控件 */
 		
 		
 		$(".getStaff").click(function(){
 			
 			});
 		
 		function getStaff(idName){
 			

 			var empId=$(idName).attr("data");	
 			
			layer.open({
				type: 2,
				title: '人员选择',
				content: server_context+'/coframe/tools/plugIn/selecthrorg.jsp?empId='+empId,
				area: ['1128px', '570px'],
				btn: ['确定', '取消'],
				yes: function(index, layero){ 
					    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
					    var a=iframeWin.getData();
					    var list="";
					    var list2=""
					    $(a).each(function(i,obj){
					    	if(i=="0"){
					    		list+=obj.username;
					    		list2+=obj.empid;
					    	}else{
					    		list+=","+obj.username;
					    		list2+=","+obj.empid;
					    	}
					    	
					    })
					    	$(idName).val(list);
				  			$(idName).attr("data",list2); 
				  			layer.close(layer.index);
				},
				btn2: function(index, layero){
					   layer.close(layer.index);
					  }    
				
				
			});
		}
 		
function getEmail(idName){
 			
 	 		
 			
			layer.open({
				type: 2,
				title: '人员选择',
				content: server_context+'/coframe/tools/plugIn/selecthrorg.jsp',
				area: ['1212px', '520px'],
				btn: ['确定', '取消'],
				yes: function(index, layero){ 
					    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
					    var a=iframeWin.getData();
					    var list="";
					    var list2="";
					    var list3="";
					    $(a).each(function(i,obj){
					    	if(i=="0"){
					    		list+=obj.username+'<'+obj.email+">";
					    		list2+=obj.username;
					    		list3+=obj.empid;
					    	}else{
					    		list+=","+obj.username+'<'+obj.email+">";
					    		list2+=","+obj.username;
					    		list3+=","+obj.empid;
					    	}
					    	
					    })
					    	$(idName).prev().val(list);
				  			$(idName).prev().attr("data",list2); 
				  			$(idName).prev().attr("empId",list3); 
				  			layer.close(layer.index);
				},
				btn2: function(index, layero){
					   layer.close(layer.index);
					  }    
				
				
			});
		}
 		
 		
function getOrg(idName){
 			
 	 		
 			
			layer.open({
				type: 2,
				title: '部门选择',
				content: server_context+'/coframe/tools/plugIn/selectorg.jsp',
				area: ['420px', '500px'],
				btn: ['确定', '取消'],
				yes: function(index, layero){ 
					    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
					    var a=iframeWin.getData();
					    var L1="";
					    var L1name="";
					    var L2="";
					    var L2name="";
					    var L3="";
					    var L3name="";
					    var L4="";
					    var L4name="";
					    var alias=""
					    var allName=""
					    $(a).each(function(i,obj){
					    		L1+=obj.L1id;
					    		L1name+=obj.L1name;
					    		L2+=obj.L2id;
					    		L2name+=obj.L2name;
					    		L3+=obj.L3id;
					    		L3name+=obj.L3name;
					    		L4+=obj.L4id;
					    		L4name+=obj.L4name;
					    		alias+=obj.alias;
					    		allName+=obj.aliasName
					    		
					    })
					    	$(idName).val(allName);
					    	$(idName).attr("alias",alias); 
				  			$(idName).attr("L1",L1); 
				  			$(idName).attr("L1name",L1name); 
				  			$(idName).attr("L2",L2); 
				  			$(idName).attr("L2name",L2name); 
				  			$(idName).attr("L3",L3); 
				  			$(idName).attr("L3name",L3name); 
				  			$(idName).attr("L4",L4); 
				  			$(idName).attr("L4name",L4name); 
				  			layer.close(layer.index);
				},
				btn2: function(index, layero){
					   layer.close(layer.index);
					  }    
				
				
			});
		}
//选择L2部门的部门选择插件
function getL2Org(idName){

	layer.open({
		type: 2,
		title: '部门选择',
		content: server_context+'/coframe/tools/plugIn/selectorgL2.jsp',
		area: ['420px', '500px'],
		btn: ['确定', '取消'],
		yes: function(index, layero){ 
			    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
			    var a=iframeWin.getData();
			    var L1="";
			    var L1name="";
			    var L2="";
			    var L2name="";
			    var L3="";
			    var L3name="";
			    var L4="";
			    var L4name="";
			    var alias=""
			    var allName=""
			    $(a).each(function(i,obj){
			    		L1+=obj.L1id;
			    		L1name+=obj.L1name;
			    		L2+=obj.L2id;
			    		L2name+=obj.L2name;
			    		L3+=obj.L3id;
			    		L3name+=obj.L3name;
			    		L4+=obj.L4id;
			    		L4name+=obj.L4name;
			    		alias+=obj.alias;
			    		allName+=obj.aliasName
			    		
			    })
			    	$(idName).val(allName);
			    	$(idName).attr("alias",alias); 
		  			$(idName).attr("L1",L1); 
		  			$(idName).attr("L1name",L1name); 
		  			$(idName).attr("L2",L2); 
		  			$(idName).attr("L2name",L2name); 
		  			$(idName).attr("L3",L3); 
		  			$(idName).attr("L3name",L3name); 
		  			$(idName).attr("L4",L4); 
		  			$(idName).attr("L4name",L4name); 
		  			layer.close(layer.index);
		},
		btn2: function(index, layero){
			   layer.close(layer.index);
			  }    
		
		
	});
}
//单选
function getEntryStaff(idName){
	var StaffId=""//人员工号
	var StaffName=""//人员姓名
	layer.open({
		type: 2,
		title: '选择入职人员',
		content: server_context+'/coframe/tools/plugIn/selectStaff.jsp',
		area: ['1212px', '520px'],
		btn: ['确定', '取消'],
		yes: function(index, layero){ 
			    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
			    var a=iframeWin.getData();
			    
			    $(a).each(function(i,obj){
			    	if(i=="0"){
			    		StaffId+=obj.order;
			    		StaffName+=obj.username;
			    	}else{
			    		StaffId+=","+obj.order;
			    		StaffName+=obj.username;
			    	}
			    	
			    })
			    	$(idName).val(StaffName);
			    	$(idName).attr("data",StaffId);
		  			layer.close(layer.index);
			    
		},
		btn2: function(index, layero){
			   layer.close(layer.index);
			  }    
		
		
	});
}



//单选邮箱
function getEntryStaff2(idName){
	var StaffId=""//人员工号
	var StaffName=""//人员姓名
	layer.open({
		type: 2,
		title: '选择入职人员',
		content: server_context+'/coframe/tools/plugIn/selectStaff.jsp',
		area: ['1212px', '520px'],
		btn: ['确定', '取消'],
		yes: function(index, layero){ 
			    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
			    var a=iframeWin.getData();
			    
			    $(a).each(function(i,obj){
			    	if(i=="0"){
			    		StaffId+=obj.order;
			    		StaffName+=obj.username+'<'+obj.email+">";
			    	}else{
			    		StaffId+=","+obj.order;
			    		StaffName+=obj.username+'<'+obj.email+">";
			    	}
			    	
			    })
			    	$(idName).val(StaffName);
			    	$(idName).attr("data",StaffId);
		  			layer.close(layer.index);
			    
		},
		btn2: function(index, layero){
			   layer.close(layer.index);
			  }    
		
		
	});
}